<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
	<meta name="apple-mobile-web-app-capable" content="yes"/>
	<title>Button List</title>

	<link href="../themes/common/domButtons/DomButtonColorButtons.css" rel="stylesheet"/>
	<script type="text/javascript" src="../deviceTheme.js" data-dojo-config="mblThemeFiles: ['base']"></script>
	<script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: true"></script>

	<script type="text/javascript">
		require([
			"dojo/_base/connect",
			"dojo/dom",
			"dojo/dom-class",
			"dojo/ready",
			"dijit/registry",
			"dojox/mobile/parser",
			"dojox/mobile",
			"dojox/mobile/compat"
		], function(connect, dom, domClass, ready, registry){
			function btnClicked(e){
				var listItem = registry.getEnclosingWidget(e.currentTarget);
				var btnDiv = listItem.rightIconNode.firstChild;
				if(domClass.contains(btnDiv, "mblDomButtonBluePlus")){
					listItem.set("rightIcon", "mblDomButtonRedMinus");
				}else if(domClass.contains(btnDiv, "mblDomButtonRedMinus")){
					listItem.set("rightIcon", "mblDomButtonBluePlus");
				}
			}
			ready(function(){
				var ul = dom.byId("list");
				for(var i = 0, len = ul.childNodes.length; i < len; i++){
					var li = ul.childNodes[i];
					if(li.nodeType != 1 || li.tagName != "LI"){ continue; }
					var w = registry.byNode(li);
					connect.connect(w.rightIconNode, "onclick", btnClicked);
				}
			});
		});
	</script>
</head>
<body style="visibility:hidden;">
	<div id="mashups" data-dojo-type="dojox.mobile.View">
		<h1 data-dojo-type="dojox.mobile.Heading">Mashups</h1>
		<ul id="list" data-dojo-type="dojox.mobile.EdgeToEdgeList">
			<li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"images/i-icon-1.png", rightIcon:"mblDomButtonBluePlus"'>
				XX Widget
			</li>
			<li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"images/i-icon-2.png", rightIcon:"mblDomButtonRedMinus"'>
				YY Widget
			</li>
		</ul>
	</div>
</body>
</html>
